using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ObjectMapper.Benchmark.DataModel
{
    internal class PhoneNumberTypeConfiguration : EntityTypeConfiguration<PhoneNumberType>
    {
        public PhoneNumberTypeConfiguration()
        {
            ToTable("Person.PhoneNumberType");
            HasKey(x => x.PhoneNumberTypeId);

            Property(x => x.PhoneNumberTypeId)
                .HasColumnName("PhoneNumberTypeID")
                .IsRequired()
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            Property(x => x.Name).HasColumnName("Name").IsRequired().HasMaxLength(50);
            Property(x => x.ModifiedDate).HasColumnName("ModifiedDate").IsRequired();
        }
    }
}